<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "common_config_cate".
 *
 * @property int $id 主键
 * @property string $title 标题
 * @property int|null $pid 上级id
 * @property string $app_id 应用
 * @property int|null $level 级别
 * @property int|null $sort 排序
 * @property string $tree 树
 * @property int|null $status 状态[-1:删除;0:禁用;1启用]
 * @property int|null $created_at 添加时间
 * @property int|null $updated_at 修改时间
 */
class ConfigCate extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'common_config_cate';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['pid', 'level', 'sort', 'status', 'created_at', 'updated_at'], 'integer'],
            [['title'], 'string', 'max' => 50],
            [['app_id'], 'string', 'max' => 20],
            [['tree'], 'string', 'max' => 300],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'pid' => 'Pid',
            'app_id' => 'App ID',
            'level' => 'Level',
            'sort' => 'Sort',
            'tree' => 'Tree',
            'status' => 'Status',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
